package com.jp.hilt;

import dagger.Module;
import dagger.Provides;
import dagger.hilt.InstallIn;
import dagger.hilt.android.components.ActivityComponent;
import dagger.hilt.android.scopes.ActivityScoped;

/**
 * @ProjectName : Hilt_BaseUse
 * @Author : Jason
 * @Time : 2021/8/29 18:30
 * @Description : @InstallIn(ActivityComponent.class)对应@Singleton   全局单例
 * @InstallIn(ApplicationComponent.class) 对应@ActivityScoped 局部单例  在声明的作用域中单例有效
 */
@InstallIn(ActivityComponent.class)
@Module
public class HttpModule {
    @Provides
    @ActivityScoped
    public HttpObject getHttpObject() {
        return new HttpObject();
    }
}
